package com.xcesys.extras.dataobject.system;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

import com.xcesys.extras.dataobject.EditableObject;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CodeList")
public class CodeList extends EditableObject {

	private static final long serialVersionUID = 2228696763147818707L;

	/** Code Type */
	private CodeType codeType;

	private Long typeId;

	private String description;

	private String name;

	private Integer seq;

	private String value;

	public CodeList() {
	}

	public CodeType getCodeType() {
		return this.codeType;
	}

	public String getDescription() {
		return description;
	}

	public String getName() {
		return this.name;
	}

	public Integer getSeq() {
		return this.seq;
	}

	public Long getTypeId() {
		return typeId;
	}

	public String getValue() {
		return this.value;
	}

	public void setCodeType(CodeType tcSysCodeType) {
		this.codeType = tcSysCodeType;
	}

	public void setDescription(String description) {
		Object oldValue = this.description;
		this.description = description;
		firePropertyChange("description", oldValue, description);
	}

	public void setName(String codeValueDescE) {
		this.name = codeValueDescE;
	}

	public void setSeq(Integer sortNo) {
		this.seq = sortNo;
	}

	public void setTypeId(Long typeId) {
		Object oldValue = this.typeId;
		this.typeId = typeId;
		firePropertyChange("typeId", oldValue, typeId);
	}

	public void setValue(String codeValue) {
		this.value = codeValue;
	}

	/**
	 * Constructs a <code>String</code> with all attributes in name = value
	 * format.
	 * 
	 * @return a <code>String</code> representation of this object.
	 */
	@Override
	public String toString() {
		final String TAB = "    ";

		String retValue = "";

		retValue = "CodeList ( " + super.toString() + TAB + "codeType = "
				+ this.codeType + TAB + "description = " + this.description
				+ TAB + "name = " + this.name + TAB + "seq = " + this.seq + TAB
				+ "value = " + this.value + TAB + " )";

		return retValue;
	}

}
